#include <string>
#include <vector>

using namespace std;

class Solution {
public:
    vector<string> buildArray(vector<int>& target, int n) {
        vector<string> ans;
        int i = 0;
        for (int num = 1; num <= n && i < target.size(); num++) {
            ans.emplace_back("Push");
            if (num == target[i]) {
                i++;
            } else {
                ans.emplace_back("Pop");
            }
        }
        return ans;
    }
};